import React from 'react';
import { Comment } from '../02-评论列表V1/Comment';

export class App extends React.Component {
  constructor() {
    super();
    this.inputRef = React.createRef();
    this.commentRef = React.createRef();
  }

  handleSubmitClick = () => {
    console.log(this.inputRef.current.value);
    this.inputRef.current.focus();
    console.log(this.commentRef.current.state.list);
  };

  render() {
    return (
      <div>
        <input type="text" ref={this.inputRef}></input>
        <Comment ref={this.commentRef} />
        <button onClick={this.handleSubmitClick}>提交</button>
      </div>
    );
  }
}
